package com.ysd.lis.controller.bac;

import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.bac.BacAntClassDto;
import com.ysd.lis.entity.bac.BacDrugResultSenrole;
import com.ysd.lis.entity.bac.BacDrugResultSenroleDetails;
import com.ysd.lis.service.bac.BacDrugResultSenroleDetailsService;
import com.ysd.lis.service.bac.BacDrugResultSenroleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wh
 * @since 2025-04-26
 */
@RestController
@RequestMapping("/bac/drugResultSenrole")
public class BacDrugResultSenroleController extends BaseController {

    @Autowired
    private BacDrugResultSenroleService bacDrugResultSenroleService;
    @Autowired
    private BacDrugResultSenroleDetailsService bacDrugResultSenroleDetailsService;

    @ApiOperation("查询")
    @GetMapping("/findSenroleList")
    public Result findSenroleList(){
        return bacDrugResultSenroleService.findSenroleList();
    }

    @ApiOperation("修改")
    @PostMapping("/saveOrUpdateSenrole")
    public Result saveOrUpdateSenrole(@RequestBody List<BacDrugResultSenrole> list) {
        return bacDrugResultSenroleService.saveOrUpdateSenrole(list);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteSenroleRule")
    public Result batchDeleteSenroleRule(@RequestBody List<BacDrugResultSenrole> list){
        return  bacDrugResultSenroleService.batchDeleteSenroleRule(list);
    }



    @ApiOperation("查询规则明细")
    @GetMapping("/findSenroleDetailsList")
    public Result findSenroleDetailsList(@RequestParam("roleCode") String roleCode){
        return bacDrugResultSenroleDetailsService.findSenroleDetailsList(roleCode);
    }


    @ApiOperation("修改规则明细")
    @PostMapping("/saveOrUpdateSenroleDeatils")
    public Result saveOrUpdateSenroleDeatils(@RequestBody List<BacDrugResultSenroleDetails> list) {
        return bacDrugResultSenroleDetailsService.saveOrUpdateSenroleDeatils(list);
    }


    @ApiOperation("批量删除")
    @PostMapping("/deleteSenroleRuleDetails")
    public Result deleteSenroleRuleDetails(@RequestBody BacDrugResultSenroleDetails bacDrugResultSenroleDetails){
        return  bacDrugResultSenroleDetailsService.deleteSenroleRuleDetails(bacDrugResultSenroleDetails);
    }


}
